﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ledict.Core.Data;
using System.Data.Common;
using Ledict.ConditionExtract.Model;
namespace Ledict.ConditionExtract.DAL
{
    public class Case_ParagraphLogicDAL
    {
        private string DbName;
        public Case_ParagraphLogicDAL()
        {
            DbName = "Caselibrary";
        }      

        /// <summary>
        /// 获取原文
        /// </summary>
        /// <param name="caseId"></param>
        /// <returns></returns>
        public DataTable  GetParagraphData(string caseId)
        {
            string sql = string.Format(@"  select ParagraphText ,ParagraphTypeId,id,caseId  from  t_Case_ParagraphLogic where CaseId='{0}'
            and ParagraphTypeId in (140,150) order by t_Case_ParagraphLogic.ParagraphTypeId desc ", caseId);
            Database oBase = DatabaseFactory.CreateDatabase(DbName);
            DbCommand oCmd = oBase.GetSqlStringCommand(sql.ToString());
            return oBase.ExecuteDataSet(oCmd).Tables[0];

        }

    }
}
